package com.office.automate.servlet.report;


import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.office.automate.dto.convertors.ReportDetailsConvertor;
import com.office.automate.model.report.EmployeeSalaryDetailsRequest;

/**
 * Servlet implementation class EmployeeSalaryDetailsReportServlet
 */
@WebServlet("/EmployeeSalaryDetailsReportServlet")
public class EmployeeSalaryDetailsReportServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public EmployeeSalaryDetailsReportServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/jsp/report/EmployeeSalaryDetailsReport.jsp");
		EmployeeSalaryDetailsRequest employeeSalaryDetailsRequest = new ReportDetailsConvertor().convertEmployeeSalaryDetailRequest(request);
		request.setAttribute("RequestDetails", employeeSalaryDetailsRequest);
		dispatcher.forward(request, response);
	}

}
